(async () => {
    const [config, util, env, libs, render, loader] = await require("config", "libs/util", "libs/env", "libs/libs", "libs/render", "libs/loader");
    const { Frame, Layer, Shape } = libs;
    const clockImage = await loader.loadImage("clock.png");
    const testImage = await loader.loadImage("map.png");
    const testImage1 = await loader.loadImage("map2.png");
    const shape = new Shape.ImageShape({
        image: testImage,
        position: new Shape.ImageShape.Position({
            x: 160,
            y: 0,
            width: 32,
            height: 32
        })
    });
    const shape2 = new Shape.ImageShape({
        image: testImage,
        position: new Shape.ImageShape.Position({
            x: 0,
            y: 0,
            width: 32,
            height: 32
        })
    });
    const shape3 = new Shape.ImageShape({
        image: testImage1,
        position: new Shape.ImageShape.Position({
            x: 480,
            y: 352,
            width: 32,
            height: 32
        })
    });
    const shape4 = new Shape.ImageShape({
        image: testImage1,
        position: new Shape.ImageShape.Position({
            x: 256,
            y: 352 - 32,
            width: 96,
            height: 96
        })
    });
    const shape5 = new Shape.ImageShape({
        image: testImage1,
        position: new Shape.ImageShape.Position({
            x: 256 + 96,
            y: 352 - 32,
            width: 32,
            height: 96
        })
    });
    const layer = new Layer({
        width: 2000,
        height: 2000
    });
    layer.fill(shape);
    const layer2 = new Layer({
        width: 2000,
        height: 2000,
        blocks: [
            new Layer.Block({
                x: 150,
                y: 150,
                width: 300,
                height: 300,
                material: shape2,
                repeat: true
            }),
            new Layer.Block({
                x: 180,
                y: 180,
                width: 32,
                height: 32,
                material: shape3
            }),
            new Layer.Block({
                x: 250,
                y: 250,
                width: 96,
                height: 96,
                material: shape4
            }),
            new Layer.Block({
                x: 250 + 96,
                y: 250,
                width: 32,
                height: 96,
                material: shape5
            }),
            new Layer.Block({
                x: 250 - 32,
                y: 250,
                width: 32,
                height: 96,
                material: shape5
            })
        ]
    });
    const frame = new Frame({
        layers: [
            layer,
            layer2
        ]
    });
    render.setFrame(frame.prepare());
})()
.catch(err => logger.fatal(err));